<template>
  <div>
    <el-container>
      <el-header>
        <el-page-header  @back="$router.push('/');"  content="Heal后台管理页面">
        </el-page-header>
      </el-header>
      <el-container>
        <el-aside width="250px">
          <AdminLeftNavbar @menu="getMenu"></AdminLeftNavbar>
        </el-aside>
        <el-main>
          <AdminIndex v-show="menu=='AdminIndex'"></AdminIndex>
          <VideoDashboard v-if="menu=='VideoDashboard'"></VideoDashboard>
          <TopicDashboard v-if="menu=='TopicDashboard.vue'"></TopicDashboard>

          <VideoTab v-show="menu=='VideoTab'"></VideoTab>
          <TopicTab v-show="menu=='TopicTab'"></TopicTab>
          <CommentTab v-show="menu=='CommentTab'"></CommentTab>
          <UserTab v-show="menu=='UserTab'"></UserTab>
        </el-main>
      </el-container>
    </el-container>
    <!--  <AdminLeftNavbar></AdminLeftNavbar>-->


  </div>
</template>

<script>
import AdminLeftNavbar from "@/components/AdminLeftNavbar";
import VideoTab from "@/components/VideoTab";
import TopicTab from "@/components/TopicTab";
import CommentTab from "@/components/CommentTab";
import UserTab from "@/components/UserTab";
import VideoDashboard from "@/components/VideoDashboard";
import TopicDashboard from "@/components/TopicDashboard";
import AdminIndex from "@/components/AdminIndex";

export default {
  name: "AdminMain",

  components: {AdminLeftNavbar, VideoTab,TopicTab,CommentTab,UserTab,VideoDashboard,TopicDashboard,AdminIndex},
  data() {
    return {

      ip: this.GLOBAL.ip,
      port: this.GLOBAL.port,
      menu: 'AdminIndex',

    };
  },


  methods: {

    getMenu(menu) {
      this.menu = menu;
    },


  },

  created() {
    // if (this.$root.sessionId == null) {
    //   this.$router.push('/');
    // }
  }


}

</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}

</style>
